package org.study.id.baidu.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import org.study.id.baidu.service.WorkerNodeService;

/**
 * 类的描述
 *
 * @author Administrator
 * @date 2021-05-27
 */
@RestController
@RequestMapping("/id/baidu")
public class WorkerNodeController {
    @Resource
    private WorkerNodeService workerNodeService;

    @GetMapping("/gen")
    public long baiduUid() {
        long uid = workerNodeService.genUid();
        return uid;
    }

    @GetMapping("/parse/{uid}")
    public String parseUid(@PathVariable("uid") long uid) {
        String parseUid = workerNodeService.parseUid(uid);
        return parseUid;
    }
}
